import pytest
from page.mailListPage.mailListPage import MailListPage


class Test_demo01():

    def test_01(self, login):
        self.page = MailListPage(login)
        # 进入通讯录界面
        self.page.into_mail_list_page()
        # 添加部门，点击-取消
        self.page.add_org(org_name="测试组织123321", is_confirm=False)

    def test_02(self, login):
        self.page = MailListPage(login)
        # 进入通讯录界面
        self.page.into_mail_list_page()
        # 添加部门，点击-取消
        self.page.add_org(org_name="测试组织123321", parent_org=True, is_confirm=False)

    def test_03(self, login):
        self.page = MailListPage(login)
        self.page.into_mail_list_page()
        self.page.add_org(org_name="测试组织06140001", is_confirm=True)
        assert self.page.my_get_text(('xpath', "//div[@id='js_tips']")) == '请选择所属部门1'



